package com.itheima.controller;


import com.itheima.pojo.LoginDto;
import com.itheima.pojo.LoginInfo;
import com.itheima.pojo.Result;
import com.itheima.service.AdminLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/adminlogin")
public class AdminLoginController {
    @Autowired
    private AdminLoginService adminLoginService;

    /**
     * 管理端登录
     * @param dto
     * @return
     */
    @PostMapping
    public Result adminLogin(@RequestBody LoginDto dto){
        LoginInfo loginInfo =adminLoginService.login(dto);

        return Result.success(loginInfo);
    }
}
